﻿using System;
using UnityEngine;

// Token: 0x020001B5 RID: 437
public class CutAct_Camera : CutAction
{
	// Token: 0x06000B5C RID: 2908 RVA: 0x000426A4 File Offset: 0x000408A4
	public CutAct_Camera(CutScene cutScene) : base(cutScene, CUTACT.CAMERA)
	{
	}

	// Token: 0x06000B5D RID: 2909 RVA: 0x000426B0 File Offset: 0x000408B0
	public CutAct_Camera(CutScene cutScene, float time, Vector3 pos, Quaternion rot, float fov) : base(cutScene, CUTACT.CAMERA, time)
	{
		this.pos = pos;
		this.rot = rot;
		this.fov = fov;
	}

	// Token: 0x06000B5E RID: 2910 RVA: 0x000426D4 File Offset: 0x000408D4
	public override object Clone()
	{
		return new CutAct_Camera(this.cutScene);
	}

	// Token: 0x06000B5F RID: 2911 RVA: 0x000426E4 File Offset: 0x000408E4
	public override void Load(TagText.Element element, int order)
	{
		base.Load(element, order);
		this.pos = TagTextUtility.Load_Vector3(element, "pos", 0);
		Vector3 zero = Vector3.zero;
		if (TagTextUtility.Load_Vector3(ref zero, element, "euler", 0))
		{
			this.rot = Quaternion.Euler(zero);
		}
		else
		{
			TagTextUtility.Load_Quaternion(ref this.rot, element, "rot", 0);
		}
		this.fov = -1f;
		element.GetVal(ref this.fov, "fov", 0);
		string empty = string.Empty;
		TagTextUtility.Load_String(ref empty, element, "focus", 0);
		if (empty == "POS")
		{
			this.focusType = CutScene.FOCUS.POS;
			TagTextUtility.Load_Vector3(ref this.focusPos, element, "focus", 1);
		}
		else if (empty == "CHARA")
		{
			this.focusType = CutScene.FOCUS.CHARA;
			TagTextUtility.Load_String(ref this.focusChara, element, "focus", 1);
		}
	}

	// Token: 0x06000B60 RID: 2912 RVA: 0x000427D4 File Offset: 0x000409D4
	public override void Save(TagText.Element element)
	{
		base.Save(element);
		TagTextUtility.Save_Vector3(element, "pos", this.pos);
		TagTextUtility.Save_Quaternion(element, "rot", this.rot);
		element.AddAttribute("fov", this.fov.ToString());
	}

	// Token: 0x06000B61 RID: 2913 RVA: 0x00042828 File Offset: 0x00040A28
	public void SetCamera()
	{
		this.cutScene.SetCamera(this.pos, this.rot, this.fov);
		if (this.focusType == CutScene.FOCUS.CHARA)
		{
			this.cutScene.SetFocus(this.focusChara);
		}
		else if (this.focusType == CutScene.FOCUS.POS)
		{
			this.cutScene.SetFocus(this.focusPos);
		}
	}

	// Token: 0x06000B62 RID: 2914 RVA: 0x00042894 File Offset: 0x00040A94
	public override void Action(bool skip)
	{
		this.SetCamera();
	}

	// Token: 0x04000BA3 RID: 2979
	public Vector3 pos;

	// Token: 0x04000BA4 RID: 2980
	public Quaternion rot;

	// Token: 0x04000BA5 RID: 2981
	public float fov;

	// Token: 0x04000BA6 RID: 2982
	public CutScene.FOCUS focusType;

	// Token: 0x04000BA7 RID: 2983
	public Vector3 focusPos;

	// Token: 0x04000BA8 RID: 2984
	public string focusChara;
}
